/*
Copyright 2011 Raymond Giorgi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */

package edu.pitt.cs3530.misc;

import java.util.ArrayList;
import java.util.List;

/**
 * This class represents a point on a graph
 */
public class Point {
	private double x;
	private double y;

	private Point(double x, double y) {
		this.x = x;
		this.y = y;
	}

	public double getX() {
		return x;
	}

	public double getY() {
		return y;
	}

	/**
	 * Create a list of points in sequential order from an array of integers
	 * 
	 * @param counts
	 * @return a list of points from an array of integers or an empty list
	 *         otherwise
	 */
	public static List<Point> createPoints(int counts[]) {
		List<Point> points = new ArrayList<Point>();
		for (int i = 0; i < counts.length; i++) {
			points.add(new Point(i - counts.length, counts[i]));
		}
		return points;
	}
}
